package com.powernode.teatraceability.service.eviinfo.impl;

import com.powernode.teatraceability.dao.depositevidence.ProCerInfoMapper;
import com.powernode.teatraceability.service.eviinfo.ProEviService;
import com.powernode.teatraceability.utils.GlobalConfig;
import com.powernode.teatraceability.utils.JsonData;
import com.powernode.teatraceability.vo.ProductCertificateVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * ClassName: proEviServiceImpl
 * Description:
 *
 * @Author: jdz
 * @Create: 2023/5/4 - 16:20
 */
@Service
public class ProEviServiceImpl implements ProEviService {
    @Resource
    private ProCerInfoMapper proCerInfoMapper;
    @Override
    public List<ProductCertificateVo> selectAll(String qymc) {
        return proCerInfoMapper.selectAll(qymc);
    }

    @Override
    public Integer insert(ProductCertificateVo cerInfo) {
        return null;
    }


    @Override
    public Integer update(ProductCertificateVo cerInfo) {
        return proCerInfoMapper.update(cerInfo);
    }

    @Override
    public Integer delete(int id) {
        return proCerInfoMapper.delete(id);
    }

    @Override
    public JsonData queryCnt(String qymc) {
        final JsonData jsonData = GlobalConfig.LOCAL.get();
        jsonData.setData(proCerInfoMapper.queryCnt(qymc));
        jsonData.setMsg("查询成功");
        jsonData.setStatus(200);
        return jsonData;
    }

    @Override
    public List<ProductCertificateVo> selectLike(String cpmc) {
        return proCerInfoMapper.selectLike(cpmc);
    }

    @Override
    public Integer countCerType(String type, String qymc) {
        return proCerInfoMapper.countCerType(type, qymc);
    }

    @Override
    public Integer countInfo(String qymc) {
        return proCerInfoMapper.countInfo(qymc);
    }
}
